<template>
  <div>
    <div ref="radar" style="width: 400px;height: 450px;"></div>
  </div>
</template>

<script>
import * as echarts from 'echarts'

export default {
  mounted() {
    this.initEchart()
  },
  methods: {
    // 初始化 echart 图表
    initEchart() {
      // 基于准备好的dom，初始化echarts实例
      const myChart = echarts.init(this.$refs.radar);
      const option = {
        // title: {
        //   text: 'Basic Radar Chart'
        // },
        legend: {
          data: ['平均水平', '个人价值']
        },
        radar: {
          // shape: 'circle',
          indicator: [
            { name: '工作效率', max: 100 },
            { name: '考勤', max: 100 },
            { name: '积极性', max: 100 },
            { name: '帮助同事', max: 100 },
            { name: '自主学习', max: 100 },
            { name: '正确率', max: 100 }
          ]
        },
        series: [
          {
            name: 'Budget vs spending',
            type: 'radar',
            data: [
              {
                value: [80, 80, 80, 80, 80, 80],
                name: '平均水平'
              },
              {
                value: [95, 85, 75, 90, 70, 95],
                name: '个人价值'
              }
            ]
          }
        ]
      };
      // 绘制图表
      myChart.setOption(option)
    }
  }
}
</script>

<style>

</style>